//1.0导入vue核心包
import Vue  from 'vue';
//2.0导入Vueroute
import vueRouter from  'vue-router';

//2.0导入App.vue的vue对象
import App from './App.vue';
//3.0 利用vue对象进行解析渲染
Vue.use(vueRouter);
//导入vueResource
import vueResource from 'vue-resource';
Vue.use(vueResource);
import home from './components/Home.vue';
import shopcar from './components/shopcar/car.vue';
import newslist from './components/news/newslist.vue';
import newsinfo from './components/news/newsinfo.vue';
import photolist from './components/photo/photolist.vue';
import photoinfo from './components/photo/photoinfo.vue';
import goodslist from  './components/goods/goodslist.vue';
import goodsinfo from  './components/goods/goodsinfo.vue';
import goodsdesc from  './components/goods/goodsdesc.vue';
import goodscomment from './components/goods/goodscomment.vue';
import car from './components/shopcar/car.vue';
var router =new vueRouter({
    linkActiveClass:"mui-active",
    routes:[
        //当服务器启动的时候,默认进入home
        {
          path:"/",
          redirect:"/home"
        },
        {
          path:"/home",
          component:home
        },
        {
            path:"/shopcar",
            component:shopcar
        },
        {
            path:"/news/newslist",
            component:newslist
        },
        {
            path:"/news/newsinfo/:id",
            component:newsinfo
        },
        {
            path:"/photo/photolist",
            component:photolist
        },
        {
            path:"/photo/photoinfo/:id",
            component:photoinfo
        },
        {
            path:"/goods/goodslist",
            component:goodslist
        },
        {
            path:"/goods/goodsinfo/:id",
            component:goodsinfo
        },
        {
            path:"/goods/goodsdesc/:id",
            component:goodsdesc
        },
        {
            path:"/goods/goodscomment/:id",
            component:goodscomment
        },
        {
            path:'/shopcar/car',
            component:car
        }
    ]
});
//使用mint ui
//导入css
import 'mint-ui/lib/style.css';
import mintui from 'mint-ui';
Vue.use(mintui);
import '../statics/mui/css/mui.css';
import  '../statics/css/site.css';
//使用日期格式
// import moment from 'moment'
// Vue.use(moment);
//在vue使用
//使用全局过滤器
import './filter/filter'

import VuePreview from 'vue-preview';
Vue.use(VuePreview);

//8.0定义全局过滤器
// Vue.filter('datefmt',function (input,fmtstring) {
//     //在方法体中使用日期格式化功能
//     return moment(input).format(fmtstring);
// })
new Vue({
    el:"#app",
    //render:function(creat){
    //    create(App)
    //}
    render:c =>c(App), //es6的函数写法 => goes to 语法
    router
});